package cn.wolfcode.p2p.business.service;

import cn.wolfcode.p2p.business.domain.BidRequest;

import java.math.BigDecimal;public interface IBidService {

    /**
     * 查询用户针对于某个借款的总投资金额
     * @param userId  投资人id
     * @param bidRequestId  借款人id
     * @return
     */
    BigDecimal getTotalBidAmountByUserIdAndBidRequestId(Long userId, Long bidRequestId);

    /**
     * 保存一个投标对象
     * @param br
     * @param amount
     */
    void save(BidRequest br, BigDecimal amount);

    /**
     * 根据借款,批量修改投标对象的状态
     * @param bidRequestId  借款的id
     * @param bidrequestState   要修改的状态
     */
    void batchUpdateStateByBidRequestId(Long bidRequestId, int bidrequestState);
}
